/**
 * 
 */
package orderProcessingProcess.server;
import java.util.List;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;

import orderProcessingProcess.exceptions.faults.ItemUnavailableFault;
import orderProcessingProcess.exceptions.faults.UnknownItemFault;
import orderProcessingProcess.exceptions.faults.UnknownOrderFault;
import orderProcessingProcess.model.Customer;
import orderProcessingProcess.model.Item;
import orderProcessingProcess.model.Order;

/**
 * @author charly
 *
 */
@WebService
public interface OrderManagementService {
	
    @WebMethod(operationName="check_availability")
    	@WebResult(name="is_available")boolean 
    	check_availability(@WebParam(name="item")Item item) 
    		throws UnknownItemFault;

    @WebMethod(operationName="place_order")
    	@WebResult(name="order")Order 
    	place_order(@WebParam(name="items")Item[] items, 
    				@WebParam(name="customer")Customer customer) 
			throws ItemUnavailableFault;
    
    @WebMethod(operationName="is_finished")
		@WebResult(name="is_finished")boolean 
		is_finished(@WebParam(name="order")Order order) 
    		throws UnknownOrderFault;
    
    @WebMethod(operationName="insert_test_data")
    	@WebResult()void 
    	insert_test_data(@WebParam(name="items")List<Item> items);
}
